﻿// Copyright (c) 2012 - 2020 Jared Zheng <jaredz at outlook dot com>
// Buddha Framework is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
//          http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
// EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
// MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
// See the Mulan PSL v2 for more details.
//
// Create : 2012-12-01 version 0.1 Jared Zheng <jaredz at outlook dot com>
// Update : 2018-12-05 version 3.1.5 Jared Zheng <jaredz at outlook dot com>

#ifndef __COMMON_SERVER_HXX__
#define __COMMON_SERVER_HXX__

#pragma once

#include "CommonServer.h"

///////////////////////////////////////////////////////////////////////////////////////////////////////////
/// 服务器标准接口SubSystem : 通过UUID查找和创建接口实例
class CCommonServerSystem : public CSubSystem
{
public:
    /// CComponent
    virtual UInt  Command(PCXStr pszCMD, uintptr_t utParam) OVERRIDE;
    virtual UInt  Update(void) OVERRIDE;
    /// CSubSystem
    virtual UInt  Init(void) OVERRIDE;
    virtual void  Exit(void) OVERRIDE;

    virtual Int   GetComponentInfo(MAP_COMPONENT_INFO& Components) OVERRIDE;
    virtual bool  FindComponent(const CUUID& uuId) OVERRIDE;
    virtual bool  CreateComponent(const CUUID& uuId, CComponentPtr& CComponentPtrRef) OVERRIDE;
public:
    CCommonServerSystem(void);
    virtual ~CCommonServerSystem(void);
private:
    CCommonServerSystem(const CCommonServerSystem&);
    CCommonServerSystem& operator=(const CCommonServerSystem&);
};

INLINE CCommonServerSystem::CCommonServerSystem(void)
{
}

INLINE CCommonServerSystem::~CCommonServerSystem(void)
{
}

INLINE CCommonServerSystem::CCommonServerSystem(const CCommonServerSystem&)
{
}

INLINE CCommonServerSystem& CCommonServerSystem::operator=(const CCommonServerSystem&)
{
    return (*this);
}
// CComponent
INLINE UInt CCommonServerSystem::Command(PCXStr, uintptr_t)
{
    return 0;
}

INLINE UInt CCommonServerSystem::Update(void)
{
    return 0;
}

INLINE UInt CCommonServerSystem::Init(void)
{
    return (UInt)RET_OKAY;
}

INLINE void CCommonServerSystem::Exit(void)
{
}

#endif // __COMMON_SERVER_HXX__
